<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
<title>登录</title>
<link rel="stylesheet" href="<?php echo $_BASE_DIR ?>baodan/css/common.css" >
<link rel="stylesheet" href="<?php echo $_BASE_DIR ?>baodan/css/login.css" >
<script type="text/javascript" src="<?php echo $_BASE_DIR ?>baodan/js/jquery-3.1.1.min.js"></script>
<style>
	.login-footer{width:84%;position: fixed;bottom: 70px;left: 8%;z-index: 33;height:94px;}
	.third-party{ font-size: 14px; text-align: center; color:#b3b3b3;}
	.third-party span{ padding:0 12px; background-color: #fff; text-align: center;}
	.devide-line{ width:100%;height:1px;background-color: #ccc; top:10px; position: absolute; left:0;  z-index: -10;}
	.wechat-login{display: block;margin:25px auto 0;width:48px;height:48px;}

</style>

</head>

<body>
<header class="header">
    <a class="back" href="javascript:history.back(-1)"></a>
	<div class="title">登录</div>
</header>
<div style="height:40px;"></div>


<ul class="login">
  <li ><span>手  机：</span><input type="text"  name="username"  id="phone" value=""  placeholder="请输入您的手机号" /></li>
  <li ><span>密  码：</span><input type="password" name="password" id="password" value=""  placeholder="请输入密码" /></li>
</ul>


<div class="clearfix forget-me">
	<a href="/baodan/register"><span class="forget-code fl">新用户注册？</span></a>
	<a href="/baodan/forgetpwd"><span class="forget-code fr">忘记密码？</span></a>
</div>


<div class="log-on">
    <ul>
		<li><a  href="javascript:void(0)" onclick ="saveForm()"><p>登 录</p></a></li>
    </ul>
</div>

<script>
function saveForm(){
	
	var account = $("#phone").val();
	
	var password = $("#password").val();

	//清空页面数据

	if (account == "" || password == "" ) {
		
		alert("请完善信息");
		return false;
	}

	var ajaxurl = "/baodan/login";
	$.post(ajaxurl, {
		account: account,
		password: password,
	}, function(data){
		if(data.code == 0){
			location.href= '/baodan/index';
			return false;	
		}else{
			alert(data.msg);
			return false;	
		}
	}, 'json');
}

</script>

</body>
</html>
